package com.zhangdi.demo.jdbc.impl;

import com.zhangdi.demo.jdbc.entity.User;
import com.zhangdi.demo.jdbc.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhangdi
 * @version 1.0
 * @date 2022.5.17 0:05
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public List<User> findAll() {
        return userMapper.findAll();
    }

    @Override
    public void add(User user) {
        userMapper.insert(user);
    }
}
